<?php

// 测试日志统计API
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:8000/api/logs/statistics');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Accept: application/json',
    'Authorization: Bearer 26|Xx7QzMddc8wAVDVTLMeN0H4jO7fxr8h8W4bDxwMq4d2a6c8b'
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "HTTP状态码: $httpCode\n";
echo "响应内容:\n$response\n";

if ($httpCode === 200) {
    $data = json_decode($response, true);
    echo "\n解析后的数据:\n";
    print_r($data);
} else {
    echo "\nAPI调用失败\n";
}
